<div id="maincontent">

<%= render :partial => "shared_common_files/data_area_help_bar" %>

<h2>Control Panel > Configure System Settings</h2>
<h5></h5>	
  
    <% for name in [:notice, :warning, :message] %>
    <% if flash[name] %>
      <%= "<div class='message-fatal'> #{flash[name]} </div>" %>
    <% end %>
  <% end %>

    <% for name in [:simplemsg] %>
    <% if flash[name] %>
      <%= "<div class='message-justmsg'> #{flash[name]} </div>" %>
    <% end %>
  <% end %>
  

    <form action='/controlpanel/appconfig' name='appconfig_form' method='post' class='appform'>
    <fieldset>
        <h3>Update Application Settings</h3>
            <table>
                <%
                          count=1
                          rowtype="odd"
                            @config.each_key {|key| 
                              config_hash = @config[key]
                              @helptext = config_hash['helptext']
                              @display_options = config_hash['display_options']
                              @control_type = config_hash['control_type']
                              @value = config_hash['value']
                              @label = config_hash['label']
                              @show = config_hash['show']
                              @readonly = config_hash['readonly']
                              
                              
                               
                %>
                <%if @show!=nil and @show='true'%>
                    <tr class="<%=get_row_type(count)%>" >
                        
                        <td>
                            <label style="font-size:11px;"><b style="width:20em;"><%=@label%></b> <br/>
                            <%=@helptext%></label>
                        </td>

                        <td>
                        <!--
                        <label for="name"><b><%= @label%></b><br/><%= @helptext %></label>
                        -->
                        
                        <%if @display_options!=nil%>
                        
                            <% if @control_type==nil and @control_type!='radio' %>
                                <select name="<%=key%>">
                            <%end%> 
                                                       
                            <% @display_options.each  {|option| 
                               @option_vals = option.split(/,\s*/)
                               @option_display = @option_vals[0]
                               @option_value = @option_vals[1]
                               @selected = "" 
                               @checked = ""

                               if @option_value!=nil and @option_value == @value
                                   @selected = "selected"
                                   @checked = "checked"
                               end    
                            %>
                                <% if @control_type!=nil and @control_type=='radio' %>
                                    <input type="radio" name="<%=key%>" value="<%=@option_value%>" <%=@checked%> /> <font size="2"> <%=@option_display%></font>
                               <%else%>
                                     <option value="<%=@option_value%>" <%=@selected%>> 
                                             <%=@option_display%>  
                                      </option>                               
                                <%end%>
                            <%}%>
                            <% if @control_type==nil and @control_type!='radio' %>
                                </select>
                            <%end%> 
                        <%else%>
                            <%if @readonly!=nil and @readonly ='true'%>
                                <font size="2"> <%=@value%></font>
                            <%else%>    
                                <input size='20' type='text' name='<%=key%>' 
                                 value='<%=@value%>'/>
                            <%end%> 
                        <%end%>     
                        </td>
                     </tr>
                     <% count = count + 1 %>
                 <%end%> 
             
              <% }%>
                 
            </table>
            <div class="f-submit-wrap">
		  	  <input type="hidden" name="op" value="save"/>
             
              
              <!-- input type='submit' name='savebutton' value='Save'/ -->
		  	  <!-- %= link_if_authorized submit_tag('Cancel'), {:action => 'list'}  % -->
      
              <%= image_submit_tag "/themes/odotclassic/images/btn_save.png", :alt => 'Save', :border => 0 %>		      
		      <%= link_to image_tag('/themes/odotclassic/images/btn_cancel.gif', :alt => 'Cancel'),  :action => 'list'%>
		    </div>
              
			
        </fieldset>
    </form>



</div>




